//
//  BaseViewController.m
//  BaoVn
//
//  Created by Le Anh Tai on 11/3/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (instancetype)init
{
    if (self = [super init])
    {
        _contentView = [[UIView alloc] init];
        _contentView.backgroundColor = [UIColor clearColor];
    }
    
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	
    [self.view addSubview:_contentView];
}

- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];
    
    [self setFrameContentView];
}

- (void)setFrameContentView
{
    _contentView.frame = self.view.bounds;
}

- (void)pushController:(BaseViewController *)controller animated:(BOOL)animated
{
    [self.navigationController pushViewController:controller animated:animated];
}

- (UIViewController *)popControllerWithAnimated:(BOOL)animated
{
    UIViewController *controller = [self.navigationController popViewControllerAnimated:YES];
    
    return controller;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
